#include <AtlasBase.h>
#include <AtlasCommon.h>
#include <AtlasServer.h>

#include "ExLobbyRoomNode.h"

namespace Atlas
{

	CExLobbyRoomComponent::CExLobbyRoomComponent(CExLobbyRoomNodeServer* pServer) : CServerComponent(pServer), m_RoomStub(this)
	{
		pServer->RegisterStub(GetServerStubID<::ROOM_C2S>(),
		std::tr1::bind( &ROOM_STUB::OnData, &m_RoomStub, std::tr1::placeholders::_1, std::tr1::placeholders::_2, std::tr1::placeholders::_3, std::tr1::placeholders::_4)
		);
	}

	CExLobbyRoomComponent::~CExLobbyRoomComponent()
	{
	}

	void CExLobbyRoomComponent::LoginDone(CExLobbyRoomNodeClient* pClient)
	{
	}

	CExLobbyRoomNodeServer::CExLobbyRoomNodeServer(CServerApp* pServerApp) : CNodeServer(pServerApp, NODEID_AVATAR)
	{
		AddComponent(ATLAS_NEW CExLobbyRoomComponent(this));
	}

	CExLobbyRoomNodeServer::~CExLobbyRoomNodeServer()
	{
	}

	CNodeClient* CExLobbyRoomNodeServer::NewNodeClient(_U64 nndx, _U64 cndx, HSERVER hCluster)
	{
		return ATLAS_NEW CExLobbyRoomNodeClient(this, nndx, cndx, hCluster);
	}

	CExLobbyRoomNodeClient::CExLobbyRoomNodeClient(CExLobbyRoomNodeServer* pServer, _U64 nndx, _U64 cndx, HSERVER hCluster) : CNodeClient(pServer, nndx, cndx, hCluster), Room(this)
	{
	}

	CExLobbyRoomNodeClient::~CExLobbyRoomNodeClient()
	{
	}

	void CExLobbyRoomNodeClient::OnConnect(_U32 len, const _U8* data)
	{
	}

	void CExLobbyRoomNodeClient::OnDisconnect()
	{
		CNodeClient::OnDisconnect();
	}

	void CExLobbyRoomNodeClient::OnData(_U16 code, _U32 len, const _U8* data)
	{
	}

	void CExLobbyRoomNodeClient::OnEvent(_U16 code, _U32 len, const _U8* data)
	{
	}

}
